﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Explorer.aspx.cs" Inherits="TPCN.Admincp.Explorer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>File Explorer Dialog</title>
    <style type="text/css">
        html, body
        {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
    <form id="explorer" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        function getRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function OnClientFileOpen(sender, args) {
            var item = args.get_item();
            if (item.get_type() == Telerik.Web.UI.FileExplorerItemType.File) {
                args.set_cancel(true);
                var wnd = getRadWindow();
                var openerPage = wnd.BrowserWindow;
                wnd.close();
                openerPage.OnFileSelected(item.get_path());
            }
        }
    </script>
    <telerik:RadFileExplorer ID="FileExplorer" runat="server" Width="530" Height="500"
        onclientfileopen="OnClientFileOpen">
        <Configuration ViewPaths="~/UploadImages" />
    </telerik:RadFileExplorer>
    </form>
</body>
</html>
